package com.yan.service.impl;


import com.yan.beans.AllInfo;
import com.yan.beans.AppInfo;
import com.yan.beans.BannerInfo;
import com.yan.beans.WebAppInfo;
import com.yan.mapper.AppInfoMapper;
import com.yan.mapper.BannerInfoMapper;
import com.yan.service.AppInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2019/12/6 0006.
 */
@Service
public class AppInfoServiceImpl implements AppInfoService{
    @Resource
    private AppInfoMapper appInfoMapper;
    @Resource
    private BannerInfoMapper bannerInfoMapper;
    @Override
    public AppInfo getAppInfo() {
        return appInfoMapper.getAppInfo();
    }

    @Override
    public List<WebAppInfo> getWebInfo() {
        return appInfoMapper.getWebInfo();
    }

    @Override
    public AllInfo getAllInfo() {
        AllInfo allInfo=new AllInfo();
        AppInfo appInfo = appInfoMapper.getAppInfo();
        List<WebAppInfo> webInfo = appInfoMapper.getWebInfo();
        List<BannerInfo> info = bannerInfoMapper.getInfo();
        allInfo.setAppInfo(appInfo);
        allInfo.setWebInfos(webInfo);
        allInfo.setBannerInfos(info);

        return allInfo;
    }
}
